﻿@namespace MatBlazor
@using Microsoft.AspNetCore.Components.Routing;
@inherits BaseMatNavItem

<CascadingValue Value="@this">

    @if (string.IsNullOrEmpty(Href) || Disabled)
    {
        <li class="@ClassMapper.AsString()" @onmousedown="OnMouseDown" style="@StyleMapper.AsString()" @ref="Ref" @attributes="Attributes" Id="@Id" @onclick="OnClickHandler">
            @ChildContent
        </li>
    }
    else
    {
        <li class="mdc-nav-li" @ref="Ref" @attributes="Attributes" Id="@Id">
            <NavLink class="@ClassMapper.AsString()" style="@StyleMapper.AsString()" href="@Href" @onclick="OnClickHandler" Match="NavLinkMatch.Prefix" ActiveClass="mdc-list-item--selected">
                @ChildContent
            </NavLink>
        </li>
    }

</CascadingValue>
